From: Florian Müllner Date: Thu, 25 Jun 2020 22:25:22 +0000 (+0200) Subject: workspacesView: Small cleanup X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~203 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=da738988cd9a7396baeb553e90f7355ac8137ca7;p=gnome-shell.git workspacesView: Small cleanup scrollToActive() and friends are only used for handling the 'switch-workspace' animation. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1333 --- diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 0728d2151..a6098cac4 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -508,25 +508,11 @@ class WorkspacesDisplay extends St.Widget { workspaceManager.get_active_workspace_index(); } - _activeWorkspaceChanged(_wm, _from, _to, _direction) { - if (this._gestureActive) - return; - - this._scrollToActive(); - } - - _scrollToActive() { - let workspaceManager = global.workspace_manager; - let active = workspaceManager.get_active_workspace_index(); - - this._updateScrollAdjustment(active); - } - - _updateScrollAdjustment(index) { + _activeWorkspaceChanged(_wm, _from, to, _direction) { if (this._gestureActive) return; - this._scrollAdjustment.ease(index, { + this._scrollAdjustment.ease(to, { mode: Clutter.AnimationMode.EASE_OUT_CUBIC, duration: WORKSPACE_SWITCH_TIME, });